package com.example.service.impl;

import com.example.dao.StudentMapper;
import com.example.entity.Student;
import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> findAll() {
        return studentMapper.findAll();
    }

    @Override
    public Student findById(Long id) {
        return studentMapper.findById(id);
    }

    @Override
    public Student findByStudentId(String studentId) {
        return studentMapper.findByStudentId(studentId);
    }

    @Override
    public List<Student> findByClass(String stuClass) {
        return studentMapper.findByClass(stuClass);
    }

    @Override
    public void addStudent(Student student) {
        studentMapper.insert(student);
    }

    @Override
    public void updateStudent(Student student) {
        studentMapper.update(student);
    }

    @Override
    public void deleteStudent(String studentId) {
        studentMapper.delete(studentId);
    }

    @Override
    public void updateStatus(Long id, String status) {
        studentMapper.updateStatus(id, status);
    }
} 